package code

import (
	"context"
	"io"
	"os"

	"github.com/docker/docker/api/types/image"
)

// 拉取镜像
func ImagePull() {
	cli := InitClient()

	ctx := context.Background()

	out, err := cli.ImagePull(ctx, "nginx", image.PullOptions{})
	if err != nil {
		panic(err)
	}

	defer out.Close()

	io.Copy(os.Stdout, out)
}
